package com.xh.bussiness.tools.controller;

import com.xh.bussiness.tiku.service.IQuestionTypeRelationService;
import com.xh.bussiness.tools.service.GetDataService;
import com.xh.core.annotation.ExcludeLoginTokenIntercept;
import com.xh.core.bean.AjaxResult;
import com.xh.core.constant.AjaxResultConstant;
import com.xh.core.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 * @Author daiwei
 * @Description
 * @Date 2019/2/27 11:03
 **/
@Api(tags = "题库-试题接口")
@RestController
@RequestMapping("/tools/getData")
public class GetDataController extends BaseController {

    @Autowired
    private GetDataService getDataService;

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getRoles")
    @ApiOperation(value = "同步角色", notes = "同步角色")
    public AjaxResult getRoles() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getRoles());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getBasicDatas")
    @ApiOperation(value = "基础项", notes = "基础项")
    public AjaxResult getBasicDatas() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getBasicData());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getSubject")
    @ApiOperation(value = "学科", notes = "学科")
    public AjaxResult getSubject() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getSubject());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getBookVersion")
    @ApiOperation(value = "教材版本", notes = "教材版本")
    public AjaxResult getBookVersion() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getBookVersion());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getOrgs")
    @ApiOperation(value = "分组")
    public AjaxResult getOrgs() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getOrgs());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getSchools")
    @ApiOperation(value = "校区")
    public AjaxResult getSchools() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getSchools());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getUsers")
    @ApiOperation(value = "用户")
    public AjaxResult getUsers() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getUsers());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getCourses")
    @ApiOperation(value = "课程")
    public AjaxResult getCourses() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getCourses());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getCourseIndexs")
    @ApiOperation(value = "课次")
    public AjaxResult getCourseIndexs() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getCourseIndexs());
    }


    @ExcludeLoginTokenIntercept
    @RequestMapping("/getKnowledges")
    @ApiOperation(value = "知识点查询")
    public AjaxResult getKnowledges() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getKnowledges());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getBook")
    @ApiOperation(value = "课本")
    public AjaxResult getBook() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getBook());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getChapter")
    @ApiOperation(value = "章节")
    public AjaxResult getChapter() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getChapter());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getAllMaterial")
    @ApiOperation(value = "所有资料")
    public AjaxResult getAllMaterial() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getAllMaterial());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getPublicMaterials")
    @ApiOperation(value = "公共资料")
    public AjaxResult getMaterials() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getPublicMaterials());
    }

    @ExcludeLoginTokenIntercept
    @RequestMapping("/getPrivateMaterials")
    @ApiOperation(value = "个人资料")
    public AjaxResult getPrivateMaterials() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getPrivateMaterials());
    }

    @RequestMapping("/getQuestionTypes")
    @ApiOperation(value = "试题题型")
    public AjaxResult getQuestionTypes() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getQuestionTypes());
    }


    @RequestMapping("/getQuestion")
    @ApiOperation(value = "单题试题查询")
    public AjaxResult getQuestion() throws Exception {

        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getQuestion());
    }

    @RequestMapping("/getPapers")
    @ApiOperation(value = "试卷")
    public AjaxResult getPapers() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getPapers());
    }

    @RequestMapping("/getKnowledgeTemplate")
    @ApiOperation(value = "知识元模板")
    public AjaxResult getKnowledgeTemplate() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getKnowledgeTemplate());
    }

    @RequestMapping("/getKnowledgeTemplateModule")
    @ApiOperation(value = "知识元模板详情")
    public AjaxResult getKnowledgeTemplateModule() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getKnowledgeTemplateModule());
    }

    @RequestMapping("/getKnowledgeElement")
    @ApiOperation(value = "知识元体系")
    public AjaxResult getKnowledgeElement() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getKnowledgeElement());
    }

    @RequestMapping("/getKnowledgeManager")
    @ApiOperation(value = "知识元管理")
    public AjaxResult getKnowledgeManager() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getKnowledgeManager());
    }

    @RequestMapping("/getKnowledgeContent")
    @ApiOperation(value = "知识元内容")
    public AjaxResult getKnowledgeContent() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getKnowledgeContent());
    }

    @RequestMapping("/getHandout")
    @ApiOperation(value = "讲义")
    public AjaxResult getHandout() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getHandout());
    }

    @RequestMapping("/getHandoutDetail")
    @ApiOperation(value = "讲义详情")
    public AjaxResult getKnowledgeDetail() throws Exception {
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, getDataService.getHandoutDetail());
    }


}
